<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8"/>
    <title>提取数组元素</title>
<style>
    div{
   	  width:200px;height:200px;border:1px solid black;margin:10px;float:left;
    }
</style>
<script>
    window.onload = function(){
    	var oDiv = document.getElementsByTagName('div');
    	for(i=0;i<oDiv.length;i++){
    		oDiv[i].style.background = 'red';
    	}
    }
    
</script>
</head>
<body>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</body>
</html>













































